You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 lines
424 B

import { deleteItem } from "#server/service/collection";
import { getContextUser } from "#server/utils/context";
export default defineWrappedResponseHandler({ auth: "required" }, async (event) => {
const user = getContextUser(event)!;
const id = parseInt(event.context.params!.id);
const deleted = await deleteItem(id, user.id);
if (!deleted) return R.error("收藏不存在", null);
return R.success(null);
});